import UIKit

//
@available(iOS 4.2, *)
extension QKC where AA :UIPrintFormatter {
		// default is nil. set when formatter added to a print page renderer
     open func printPageRenderer_qk_g() -> QKC<AA,YY,ZZ, UIPrintPageRenderer? >{
		 self +^ self.value.printPageRenderer
	}

		// default is 0.0. limits content to width
    open func maximumContentHeight_qk_s(_ maximumContentHeight:  CGFloat ) -> QKC<AA,YY,ZZ, CGFloat >{
		return link(next: maximumContentHeight).then_QK { $0.value.maximumContentHeight = maximumContentHeight }
	}
    open func maximumContentHeight_qk_g() -> QKC<AA,YY,ZZ, CGFloat >{
		 self +^ self.value.maximumContentHeight
	}

		// default is 0.0. limits content to height
    open func maximumContentWidth_qk_s(_ maximumContentWidth:  CGFloat ) -> QKC<AA,YY,ZZ, CGFloat >{
		return link(next: maximumContentWidth).then_QK { $0.value.maximumContentWidth = maximumContentWidth }
	}
    open func maximumContentWidth_qk_g() -> QKC<AA,YY,ZZ, CGFloat >{
		 self +^ self.value.maximumContentWidth
	}

    @available(iOS, introduced: 4.2, deprecated: 10.0)
    open func contentInsets_qk_s(_ contentInsets:  UIEdgeInsets) -> QKC<AA,YY,ZZ, UIEdgeInsets>{
		return link(next: contentInsets).then_QK { $0.value.contentInsets = contentInsets }
	}
    @available(iOS, introduced: 4.2, deprecated: 10.0)
    open func contentInsets_qk_g() -> QKC<AA,YY,ZZ, UIEdgeInsets>{
		 self +^ self.value.contentInsets
	}

	// Deprecated in favor of perPageContentInsets which produces better output
		// default is UIEdgeInsetsZero from edge of the page.  applies to content on each page (each edge applies to each page)
    open func perPageContentInsets_qk_s(_ perPageContentInsets:  UIEdgeInsets ) -> QKC<AA,YY,ZZ, UIEdgeInsets >{
		return link(next: perPageContentInsets).then_QK { $0.value.perPageContentInsets = perPageContentInsets }
	}
    open func perPageContentInsets_qk_g() -> QKC<AA,YY,ZZ, UIEdgeInsets >{
		 self +^ self.value.perPageContentInsets
	}

		// default is NSNotFound
    open func startPage_qk_s(_ startPage:  Int ) -> QKC<AA,YY,ZZ, Int >{
		return link(next: startPage).then_QK { $0.value.startPage = startPage }
	}
    open func startPage_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.startPage
	}

		// calculated
    open func pageCount_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.pageCount
	}

    open func removeFromPrintPageRenderer_qk_f() -> QKC<AA,YY,ZZ,Void>{
		 self +^ self.value.removeFromPrintPageRenderer()
	}

		// returns empty rect if index out of range
    open func rectForPage_qk_f(at pageIndex: Int) -> QKC<AA,YY,ZZ,CGRect >{
		 self +^ self.value.rectForPage(at:pageIndex)
	}

		// override point to add custom drawing
    open func draw_qk_f(in rect: CGRect, forPageAt pageIndex: Int) -> QKC<AA,YY,ZZ, CGRect>{
		 self +^ self.value.draw(in:rect, forPageAt:pageIndex) +^ rect
	}

}

//______________________________
@available(iOS 4.2, *)
extension QKC where AA :UISimpleTextPrintFormatter {
		// cannot change once drawing started
    open func text_qk_s(_ text:  String? ) -> QKC<AA,YY,ZZ, String? >{
		return link(next: text).then_QK { $0.value.text = text }
	}
    open func text_qk_g() -> QKC<AA,YY,ZZ, String? >{
		 self +^ self.value.text
	}

    @available(iOS 7.0, *)
     open func attributedText_qk_s(_ attributedText:  NSAttributedString?) -> QKC<AA,YY,ZZ, NSAttributedString?>{
		return link(next: attributedText).then_QK { $0.value.attributedText = attributedText }
	}
    @available(iOS 7.0, *)
     open func attributedText_qk_g() -> QKC<AA,YY,ZZ, NSAttributedString?>{
		 self +^ self.value.attributedText
	}

    open func font_qk_s(_ font:  UIFont?) -> QKC<AA,YY,ZZ, UIFont?>{
		return link(next: font).then_QK { $0.value.font = font }
	}
    open func font_qk_g() -> QKC<AA,YY,ZZ, UIFont?>{
		 self +^ self.value.font
	}

    open func color_qk_s(_ color:  UIColor?) -> QKC<AA,YY,ZZ, UIColor?>{
		return link(next: color).then_QK { $0.value.color = color }
	}
    open func color_qk_g() -> QKC<AA,YY,ZZ, UIColor?>{
		 self +^ self.value.color
	}

    open func textAlignment_qk_s(_ textAlignment:  NSTextAlignment) -> QKC<AA,YY,ZZ, NSTextAlignment>{
		return link(next: textAlignment).then_QK { $0.value.textAlignment = textAlignment }
	}
    open func textAlignment_qk_g() -> QKC<AA,YY,ZZ, NSTextAlignment>{
		 self +^ self.value.textAlignment
	}

}

//______________________________
@available(iOS 4.2, *)
extension QKC where AA :UIMarkupTextPrintFormatter {
		// cannot change once drawing started
    open func markupText_qk_s(_ markupText:  String? ) -> QKC<AA,YY,ZZ, String? >{
		return link(next: markupText).then_QK { $0.value.markupText = markupText }
	}
    open func markupText_qk_g() -> QKC<AA,YY,ZZ, String? >{
		 self +^ self.value.markupText
	}

}

//______________________________
@available(iOS 4.2, *)
extension QKC where AA :UIViewPrintFormatter {
    open func view_qk_g() -> QKC<AA,YY,ZZ, UIView >{
		 self +^ self.value.view
	}

}

//______________________________
extension QKC where AA :UIView {
		// returns a new print formatter each time
    open func viewPrintFormatter_qk_f() -> QKC<AA,YY,ZZ,UIViewPrintFormatter >{
		 self +^ self.value.viewPrintFormatter()
	}

		// default calls -drawRect:
    open func draw_qk_f(_ rect: CGRect, for formatter: UIViewPrintFormatter) -> QKC<AA,YY,ZZ, CGRect>{
		 self +^ self.value.draw(rect, for:formatter) +^ rect
	}

}

